<div>
    <div class="Pd10">
        <h1 class="font21" style="margin:0">{{$data['question']->title}}</h1>
        <div>
            <span class="color55">Danh mục câu hỏi: </span>
            <a href="#" class="colorRed"> {{$data['question']->category_title}}  </a>

        </div>
        <div class="PdB10 border-B-G">
            <span class="color99">Đăng bời:</span>
            <span class="color55">{{$data['question']->username}}</span>
            <span class="color99">Ngày đăng:</span>
            <span class="color55">{{ $data['question']->formattedCreatedDate() }}</span>
            <span class="color99">{{$data['question']->votes}} lượt bình chọn hữu ích</span>
            <span class="color55">{{$data['question']->views}} lượt xem </span>
        </div>
        <div>
            <h3 class="font14">
                {{$data['question']->content}}
            </h3>
        </div>
        <div class=" addvote MgTB20">
            <a class=" vote btn-send">
                Câu hỏi hữu  ích <span class="">({{$data['question']->votes}})</span>
            </a>
            <a class=" click-create-error btn-G" is_login="{{Sentry::check()? "login":"not"}}" data-toggle="modal" data-target="#content_error">Báo sai phạm</a>
            @include('frontend/errors/show')
        </div>
        <script>

            $(window).on('hashchange', function () {

                if (window.location.hash) {
                    getVoteQuestion();
                }
            });
            $(document).ready(function () {
                $(document).on('mouseenter', '.click-create-error', function (e) {
                    remove_show_create_error($(this).attr('is_login'));
                    e.preventDefault();
                });
                $(document).on('click', '.click-create-error', function (e) {

                    show_Remind_Login($(this).attr('is_login'));
                    e.preventDefault();
                });
                $(document).on('click', '.vote', function (e) {
                    getVoteQuestion();
                    e.preventDefault();
                });
            });
            function  remove_show_create_error(status) {
                if (status == "not") {
                    $('.click-create-error').attr('data-target', '');
                }
            }
            function show_Remind_Login(status) {
                if (status == "not") {
                    alert('Bạn cần đăng nhập để báo lỗi');
                }
            }
            function getVoteQuestion() {
                $.ajax({
                    type: 'POST',
                    url: '<?= route('hoi-dap') ?>/voteQuestion?votequestion=1&id_question=<?= $data['question']->id ?>',
                                dataType: 'json',
                            }).done(function (data) {
                                $('.addvote').html(data);
                            }).fail(function () {
                                alert('Posts could not be loaded.');
                            });
                        }

        </script>
    </div>
</div>